package com.syni.mdd.yhd.common.all.controller.protect.smallProgram;

import com.syni.mdd.sjb.common.component.utils.common.annotations.CheckParams;
import com.syni.mdd.yhd.common.all.service.BmsUserService;
import com.syni.mdd.yhd.common.all.service.groupBuy.BmsUserBargainService;
import com.syni.mdd.yhd.common.all.service.impl.groupBuy.BmsUserBargainServiceImpl;
import com.syni.mdd.sjb.common.component.utils.common.utils.ParamsMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @className BmsMinApp
 * @description TOO
 * @Author cfx
 * @DATE 2019/11/22 11:05
 * @VERSION 1.0
 **/
@RestController
@RequestMapping("/minGroupBuy")
public class BmsMinGroupBuyController {

    @Autowired
    BmsUserBargainService bmsUserBargainService;

    /**
     * @Description 用户端获取商家满减券
     * @Author: cfx
     * @Date: 2019/8/2
     */
    @PostMapping("/bargain")
    @CheckParams(checkAuth = true)
    public Map<String,Object> bargain(@RequestBody ParamsMap paramsMap){
        return bmsUserBargainService.bargain(paramsMap);
    }


    /**
     * @Description 获取用户的被砍价记录
     * @Author: cfx
     * @Date: 2019/8/2
     */
    @PostMapping("/getMyBargain")
    @CheckParams(checkAuth = true)
    public Map<String,Object> getMyBargain(@RequestBody ParamsMap paramsMap){
        return bmsUserBargainService.getMyBargain(paramsMap);
    }

    /**
     * @Description 协助砍价页面
     * @Author: cfx
     * @Date: 2019/8/2
     */
    @PostMapping("/helpBargainPage")
    @CheckParams
    public Map<String,Object> helpBargainPage(@RequestBody ParamsMap paramsMap){
        return bmsUserBargainService.helpBargainPage(paramsMap);
    }

    /**
     * @Description 用户协助砍价
     * @Author: cfx
     * @Date: 2019/8/2
     */
    @PostMapping("/userHelpBargain")
    @CheckParams(checkAuth = true)
    public Map<String,Object> userHelpBargain(@RequestBody ParamsMap paramsMap){
        return bmsUserBargainService.userHelpBargain(paramsMap);
    }

    /**
     * @Description 用户协助砍价
     * @Author: cfx
     * @Date: 2019/8/2
     */
    @PostMapping("/getBargainHelpRecord")
    @CheckParams(checkAuth = true)
    public Map<String,Object> getBargainHelpRecord(@RequestBody ParamsMap paramsMap){
        return bmsUserBargainService.getBargainHelpRecord(paramsMap);
    }

    /**
     * @Description 获取活动列表
     * @Author: cfx
     * @Date: 2019/8/2
     */
    @PostMapping("/getAllActivity")
    @CheckParams(checkAuth = true)
    public Map<String,Object> getAllActivity(@RequestBody ParamsMap paramsMap){
        return bmsUserBargainService.getAllActivity(paramsMap);
    }

    /**
     * @Description 获取活动列表
     * @Author: cfx
     * @Date: 2019/8/2
     */
    @PostMapping("/share")
    @CheckParams(checkAuth = true)
    public Map<String,Object> share(@RequestBody ParamsMap paramsMap){
        return bmsUserBargainService.share(paramsMap);
    }

    /**
     * @Description 获取是否砍过这个团购的情况
     * @Author: cfx
     * @Date: 2019/8/2
     */
    @PostMapping("/getMyBargainGroupBuy")
    @CheckParams(checkAuth = true)
    public Map<String,Object> getMyBargainGroupBuy(@RequestBody ParamsMap paramsMap){
        return bmsUserBargainService.getMyBargainGroupBuy(paramsMap);
    }

}
